#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int numbSum(int n)
{
	int S = 0;
	while (n)
	{
		S += n%10;
		n/=10;
	}
	return S;
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	int sum = numbSum(n);
	printf("%d", sum);
	return 0;
}